import { modelAdd, modelRemove } from './modelOpera.js';

let allObject = [];

class FLGFrameAdd {
  constructor(scene) {
    const modelData = [
      { url: './model/防雷柜体.fbx', num: 1, x: 0, y: 0, z: 0 },
      { url: './model/防雷柜.fbx', num: 1, x: 29, y: -14, z: 4.5 },
      {
        url: './model/防雷柜8.8上.fbx', children: [
          { num: 7, x: 31, y: 16, z: 24.5, offsetZ: -5 },
          { num: 7, x: 31, y: -89, z: 24.5, offsetZ: -5 },
          { num: 7, x: 31, y: -99, z: 23.5, offsetZ: -5, rotateX: Math.PI },
        ]
      },
      {
        url: './model/防雷柜8.8中间.fbx', children: [
          { num: 7, x: 30, y: 15.5, z: 21, offsetZ: -5 },
          { num: 7, x: 30, y: 5.5, z: 21, offsetZ: -5 },
          { num: 7, x: 30, y: -89.5, z: 21, offsetZ: -5 },
          { num: 7, x: 30, y: -99.5, z: 21, offsetZ: -5 },
        ]
      },
      {
        url: './model/防雷柜8.8下.fbx', children: [
          { num: 7, x: 31, y: 5, z: 23.4, offsetZ: -5 },
        ]
      },
      { url: './model/防雷柜标签.fbx', num: 1, x: 28, y: 60, z: 5 },
      { url: './model/防雷柜门框.fbx', num: 1, x: 37, y: -30, z: 5 },
      { url: './model/防雷柜玻璃门.fbx', num: 1, x: 37, y: -30, z: 5 },
    ];
    new modelAdd(modelData, (group) => {
      group.position.set(-308, -3.5, -17);
      scene.add(group);
      allObject = group;
    });
  }
}
class FLGFrameRemove {
  constructor(scene) {
    new modelRemove(scene, allObject);
  }
}
export { FLGFrameAdd, FLGFrameRemove };